Skip to content

fix(net): remove obsolete application-layer keepalive - #7127

Merged
lvs0075 merged 1 commit into
tronprotocol:release_v4.8.3from
xxo1shine:fix/net-remove-legacy-keepalive
Nov 26, 2026
Merged

lvs0075 merged 1 commit into
tronprotocol:release_v4.8.3from
xxo1shine:fix/net-remove-legacy-keepalive

Conversation

@xxo1shine

Copy link
Copy Markdown
Collaborator

What does this PR do?
Remove the legacy PING/PONG messages, handler, statistics and unused latency histogram because libp2p already manages connection liveness.

Reject the retired message codes through the existing unknown-message path and remove unused MessageTypes range helpers. Preserve the remaining message codes, libp2p keepalive, discovery and backup heartbeats.

Why are these changes required?

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

Remove the legacy PING/PONG messages, handler, statistics and unused
latency histogram because libp2p already manages connection liveness.

Reject the retired message codes through the existing unknown-message
path and remove unused MessageTypes range helpers. Preserve the remaining
message codes, libp2p keepalive, discovery and backup heartbeats.
@github-actions
github-actions Bot requested a review from 317787106 November 26, 2026 07:56

@SeriousCoding789 SeriousCoding789 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it is only code cleanup. Please put it in next release.

@halibobo1205 halibobo1205 added this to the GreatVoyage-v4.8.3 milestone Nov 26, 2026

@xxo1shine xxo1shine left a comment •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SeriousCoding789 The previous fix addressed PING/PONG rate limiting only in libp2p, while the legacy application-layer PING/PONG handlers in java-tron remained. This PR removes those remaining handlers to complete the fix across both layers. I suggest including it in the current release so the issue is fully addressed.

@waynercheung waynercheung left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 85b0e3c, LGTM. The removal is complete: no remaining references to the deleted classes, enum values, range helpers or metric key, and the 5 affected test classes pass locally (JDK 17 / aarch64, 40 tests). Liveness is unaffected: libp2p keepalive uses its own codes (0xff/0xfe).

Non-blocking suggestions:

  • [SHOULD] Keep a comment in MessageTypes that 0x22/0x23 are retired and must not be reused: v4.7.2 - v4.8.2 still decode 0x22.
  • [NIT] A few minor items:
    • docs/metrics-changelog.md still lists tron:ping_pong_latency_seconds in the baseline section; consider adding a "Removed Metrics" entry under 4.8.3.
    • legacyKeepAliveIsRejectedAtP2pEntryWithoutReply duplicates MessageHandlerTest.testLegacyKeepAliveDisconnectsWithoutPong.
    • Raw 0x22/0x23 literals in tests could be named constants.

@xxo1shine xxo1shine left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest keeping the current scope of this PR. The other message codes are unchanged, and the retired codes have not been reused. The metrics documentation records the historical baseline. The two tests cover different aspects: rejection at the message entry point and the actual disconnect behavior. Using the legacy protocol byte values directly in the tests also makes them easy to verify. These suggestions do not affect the fix, so I suggest merging the current implementation.

@lvs0075
lvs0075 merged commit 4cbb11f into tronprotocol:release_v4.8.3 Nov 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants